package pe.edu.upc.dsd.jjjar.upcbank.server.transport;

import pe.edu.upc.dsd.jjjar.upcbank.resources.client.model.Operation;


public class Result {

	public static Operation sendSuccess(){
		Operation op = new Operation();
		op.setSuccess(true);
		return op;
	}
	
	public static Operation sendSuccess(Object data){
		return sendSuccess().setData(data);
	}
	
	public static Operation sendSuccess(Object id, Object data){
		return  sendSuccess().setId(id).setData(data);
	}
	
	public static Operation sendSuccess(Object id, Object data, Object status){
		return  sendSuccess().setId(id).setData(data).setStatus(status);
	}
	
	public static Operation sendSuccess(Object id, Object data, Object data2, Object status){
		return  sendSuccess().setId(id).setData(data).setData2(data2).setStatus(status);
	}
	
	public static Operation sendError(){
		Operation op = new Operation();
		op.setSuccess(false);
		return op;
	}
	
	public static Operation sendError(String error){
		Operation op = new Operation();
		op.setSuccess(false)
		.setMessage(error);
		return op;
	}

}
